import {planListItem, planListAllList,planListManage,addPlanlist } from "@/services"
import {inteplanListItem, inteplanListAllList,inteplanListQuery,inteplanListManage,inteaddPlanList} from "@/utils/interface"
import {makeAutoObservable} from "mobx"


class planListSkill{
    constructor(){
        makeAutoObservable(this)
    }
    planlistItem:inteplanListItem[] = []
    planlistallList:inteplanListAllList[] = []
    planlistManage:inteplanListManage[] = []
    addplanlist:inteaddPlanList[] = []
    addplanlistlength:string = ''
    // 计划顶部数据
    async planListItem(){
        let result = await planListItem();
        if(result.data){
            this.planlistItem = result.data
        }
    }    
    //计划表格数据
    async planListAllList(queryParams:inteplanListQuery){
        let result = await planListAllList(queryParams)
        if(result.rows){
            this.planlistallList = result.rows
        }
    }
    //表格加载
    async planListAllListNull(){
        this.planlistallList = []
    }
    //计划管理
    async planListManage(queryManage:inteplanListQuery){
        let result = await planListManage(queryManage)
        if(result.rows){
            this.planlistManage = result.rows
        }
    }
    //计划管理加载
    async planListManageNull(){
        this.planlistManage = []
    }

}

export default new planListSkill